<template>
    <div style="height: 100px; width: 100%; background: coral;">
      这是组件C
      <div>我的名字：{{resturantName}}</div>
      <div>我aaa：</div>
    </div>
</template>

<script>
  import {mapActions, mapGetters} from 'vuex'

  export default {
        name: "comc",
        data (){
          return{
            aaa:'',
          }
        },
        watch:{
          result(newName, oldName) {
            if(this.resturantName == '1'){
              this.a()
            }
          }
        },
        computed: {
          ...mapGetters(['resturantName']), // 动态计算属性，相当于this.$store.getters.resturantName
          result: function() {
             return this.resturantName
          }
        },
        methods:{
          a(){
            alert('111111')
          }
        },
        mounted() {
         console.log(this)
        }
  }
</script>

<style scoped>

</style>
